﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MLSharp.Utilities
{
	/// <summary>
	/// Extension methods for the <see cref="Array"/> class.
	/// </summary>
	public static class ArrayExtensions
	{
		/// <summary>
		/// Provides a shorter way of calling <see cref="Array.IndexOf{T}(T[],T)"/> on
		/// an array instance.
		/// </summary>
		/// <typeparam name="T">The type of items in the array.</typeparam>
		/// <param name="array">The array to search.</param>
		/// <param name="value">The value to look for.</param>
		/// <returns>The index of the item in the array, -1 if it doesn't exist.</returns>
		public static int IndexOf<T>(this T[] array, T value)
		{
			return Array.IndexOf(array, value);
		}
	}
}
